  <template>
  <FilterTable
    ref="table"
    :columns="columns"
    :fetchapi="fetchApi"
    :params="flterValue"
    :isPagination="false"
    :isSelectColumn="false"
    :onColumnsChange="(columns) => (this.columns = columns)"
  ></FilterTable>
</template>
    <script>
import { adExposedHistoryList } from '@/api/cms-common/adexposed';
import { dictionary } from '@/utils/dictMixin';
export default {
  data() {
    return {
      fetchApi: adExposedHistoryList,
      flterValue: { adExposedId: this.initData.id }, //参数
      adExposedId: null,
      columns: this.creatHeader(),
      fetchParams: null //ipa 接口
    };
  },
  props: {
    initData: {
      type: Object,
      default: () => ({})
    }
  },
  mixins: [dictionary],
  methods: {
    init() {},
    //table表头和数据源
    creatHeader() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '变更时间',
          dataIndex: 'updatedAt',
          dateFormat: 'yyyy-MM-dd HH:mm',
          sorter: true
        },
        {
          title: '变更人',
          dataIndex: 'updatedBy',
          sorter: true
        },

        { title: '普通授权型变更前内容', dataIndex: 'oldModels', sorter: true },
        { title: '普通授权车型变更后内容', dataIndex: 'newModels', sorter: true },
        { title: '特殊授权车型变更前内容', dataIndex: 'oldSpecialModels', sorter: true },
        { title: '特殊授权车型变更后内容', dataIndex: 'newSpecialModels', sorter: true },
        {
          title: '是否广告露出变更前内容',
          dataIndex: 'oldExposed',
          sorter: true
          // render: props => {
          //   //编码转汉字
          //   return <span>{this.createDictText(props.row.exposed, 1004)}</span>;
          // }
        },
        {
          title: '是否广告露出变更后内容',
          dataIndex: 'newExposed',
          sorter: true
          // render: props => {
          //   //编码转汉字
          //   return <span>{this.createDictText(props.row.exposed, 1004)}</span>;
          // }
        }
      ];
    }
  }
};
</script>
